package cn.edu.hhu.service.Impl;

import cn.edu.hhu.Bean.AttendanceTask;
import cn.edu.hhu.Bean.Course;
import cn.edu.hhu.DAO.AttendanceTaskDao;
import cn.edu.hhu.DAO.CourseDao;
import cn.edu.hhu.DAO.impl.AttendanceTaskDaoImpl;
import cn.edu.hhu.DAO.impl.CourseDaoImpl;
import cn.edu.hhu.service.CourseService;
import jdk.jfr.Enabled;
import org.junit.Test;

import java.sql.Date;
import java.sql.Timestamp;
import java.time.LocalDateTime;
import java.util.List;

/**
 * @anthor: lddd
 * @date: 2020/5/9 - 23:15
 * @description:
 **/
public class CourseServiceImpl implements CourseService {
    private AttendanceTaskDao attendanceTaskDao = new AttendanceTaskDaoImpl();

    /**
     * 查询所有的签到信息
     * @param course
     * @return 签到信息列表
     */
    @Override
    public List<AttendanceTask> queryAllAttendanceTask(Course course) {
        List<AttendanceTask> attendanceTasks = attendanceTaskDao.queryTaskByCId(course.getCid());
        return attendanceTasks;
    }
    @Test
    public void test(){
        Timestamp now = new Timestamp(System.currentTimeMillis());
        Timestamp time1 = new Timestamp(100000);
        Timestamp time2 = new Timestamp(200000);
        System.out.println(now);
        System.out.println(time1);
        System.out.println(time2);
        System.out.println(time1.compareTo(time2));
    }
}
